Mac PHP 安装 pecl

官方

Use curl as shown below to download the go-pear.phar file or just download the go-pear.phar file via your browser.

1
2
curl -O https://pear.php.net/go-pear.phar
php -d detect_unicode=0 go-pear.phar

You’re now ready to configure PEAR for installation.

First you need to change the Installation Base.

  1. So type 1, and then press Enter.
  2. Enter /usr/local/pear
  3. Press Enter.

Then, you will need to change the Binaries directory.

  1. Type 4, and then press Enter.
  2. Enter /usr/local/bin
  3. Press Enter.

Once you have changed the Installation Base and the Binaries Directory, press Enter to install PEAR.

中文安装指导

pear/pecl 需要单独进行安装,以下是安装步骤

  1. 下载pear
1
curl -O http://pear.php.net/go-pear.phar
  1. 安装pear
1
sudo php -d detect_unicode=0 go-pear.phar
  1. 执行以上命令后会进行安装过程,会有一些配置选项
1
2
输入1,回车,输入pear路径为:/usr/local/pear
输入4,回车,输入命令路径为:/usr/local/bin
  1. 回车两次,其他让其默认,安装完成
  2. 可以通过命令检查pear安装是否成功 `pear version